<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title> {$action} | {:get_opinion('title')}</title>

    <include file="Public:head"/>

</head>
<body class="skin-blue">

{:W('Common/header')}

<div class="wrapper row-offcanvas row-offcanvas-left">
    {:W('Common/sideMenu')}


    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">
        <!-- Content Header (Page header) -->


        <section class="content-header">
            <h1>
                {$action}-{$listname}
                <small>{:get_opinion('title')}</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{$module_url}"><i class="fa fa-dashboard"></i> {$module}</a></li>
                <li class="active">{$action}</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-md-12">

                    <!-- /.box-header -->
                    <div class="box-body">

                        <div class="row" style="padding-bottom: 10px;">
                            <div class="col-md-3">
                                <div class="btn-group">
                                    <a href="{:U('Admin/Access/adduser')}">
                                        <button id="sample_editable_1_new" class="btn btn-success">
                                            <i class="icon-plus"></i>添加新用户
                                        </button>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <!-- BEGIN EXAMPLE TABLE PORTLET-->

                        <table
                                class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>UID</th>
                                <th>账号</th>
                                <th>状态</th>
                                <th>用户组</th>
                                <th>文章数量</th>

                                <th class="col-md-2">开通时间</th>
                                <th class="col-md-3">操作</th>

                            </tr>
                            </thead>
                            <volist name="list" id="vo">
                                <tr   aid="{$vo.user_id}">
                                    <td>{$vo.user_id}</td>
                                    <td>{$vo.user_login}</td>
                                    <td>{$vo.user_status}</td>
                                    <td>{$vo.role_info.0.name}</td>
                                    <td>{$vo.post_count}</td>
                                    <td>{$vo.user_registered}</td>

                                    <td>

                                        <a class="btn btn-sm btn-primary"
                                           href="{:U('Admin/Access/editUser',array('aid'=>$vo['user_id']))}">编辑</a>
                                        <a class="btn btn-sm  btn-danger"
                                           href="{:U('Admin/Access/delUser',array('aid'=>$vo['user_id']))}">删除</a>
                                        <a class="btn btn-sm btn-info"
                                           href="{:U('Admin/Access/setusercat',array('id'=>$vo['user_id']))}"
                                           class="edit">投稿分类</a>
                                    </td>
                                </tr>
                            </volist>
                        </table>


                        <div>
                            <ul class="pagination"> {$pager}</ul>
                        </div>

                    </div>
                </div>
            </div>

        </section>
        <!-- /.content -->
    </aside>
    <!-- /.right-side -->
</div>
<!-- ./wrapper -->

<include file="Public:foot"/>
<script>
    jQuery(document).ready(function () {
        $("#cache_table :checkbox").attr("checked", true);


        $("#checkall").click(function () { //":checked"匹配所有的复选框
            $("#cache_table :checkbox").attr("checked", true); //"#div1 :checked"之间必须有空格checked是设置选中状态。如果为true则是选中fo否则false为不选中
            $("span").addClass("checked");
        });
        $("#check_cancel").click(function () {
            $("#cache_table :checkbox").attr("checked", false);
            $("span").removeClass("checked");
        });
        //理解用迭代原理each（function(){}）
        $("#check_reverse").click(function () {
            $("#cache_table :checkbox").each(function () {

                $(this).attr("checked", !$(this).attr("checked"));
                $(this).parentsUntil('div').toggleClass("checked");


                //!$(this).attr("checked")判断复选框的状态：如果选中则取反
            });
        });
    });
</script>
</body>
</html>